package collection;

import object.Point;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class NewForDemo {
    public static void main(String[] args) {

        Collection c=new ArrayList();
        c.add("hello");
        c.add(5);
        c.add(new Point(1,2));

        Collection<String>cc=new ArrayList<>();
        Iterator<String> it=c.iterator();


        /*
        String[] array={"one","two","three","four","five"};
        for(int i=0;i<array.length;i++){
            System.out.println(array[i]);

        }

        for(String str:array){
            System.out.println(str);
        }
        Collection c=new ArrayList();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        c.add("five");


        Iterator it=c.iterator();
        while(it.hasNext()){
            String str=(String)it.next();
            System.out.println(str);
        }




        for(Object object:c){
            String str=(String)object;
            System.out.println(str);
        }


        */


        String[] array1={"one","two","three","four"};
        for(String str:array1){
            System.out.println(str);
        }

        Collection c1=new ArrayList();
        c1.add("A");
        c1.add("B");
        c1.add("C");
        Iterator ite=c1.iterator();

    }
}
